# -*- coding: cp936 -*-
import socket, select, sys
import time
from random import Random

sock = socket.socket(socket.AF_INET ,socket.SOCK_STREAM, 0)
address=('192.168.1.101', 50006)
sock.connect(address)

sock.send('\x01\x02')
buff = sock.recv(8192)
if buff[1] == '\x00':
	print "current mode: wifi"
	sock.send('\x01\x00')
	print "change to 433M now"
elif buff[1] == '\x01':
	print "current mode: 433M"
	sock.send('\x01\x01')	
	print "change to wifi now"

sock.close()
'''
str_input = raw_input()
if str_input == '433':
	print 'switch to 433'
	sock.send('\x01\x00')
elif str_input == 'wifi':
	print 'switch to wifi'
	sock.send('\x01\x01')
else:
	sock.close()
'''
